<?php echo $this->renderPartial('_search_form', array('model' => $model)); ?>

<div class="row">
    <div class="span810">
        <h2>Mới</h2>
        <ul class="grid-layout">
            <?php if (sizeof($items)): ?>
                <?php foreach ($items as $item): ?>
                    <li>
                        <a href="#">
                            <?php if (strpos($item->image, 'http') === 0): ?>
                                <img title="<?php ?>" src="<?php echo $item->image ?>" style="max-height: 83px"/>
                            <?php else: ?>
                                <img title="<?php ?>" src="<?php echo Yii::app()->request->baseUrl . '/' . $item->image ?>"/>
                            <?php endif; ?>
                        </a>
                        <div class="item-detail">
                            <span class="ellipsis"><?php echo $item->title ?></span>
                            <span><a href="<?php echo $item->link ?>" target="_blank" class="ellipsis">Chi tiết</a></span>
                            <span><?php echo $item->price ?></span>
                            <span>
                                Tags:
                                <?php
                                if (empty($tag_id))
                                {
                                    $array = array();
                                    foreach ($item->item_tags as $item_tag)
                                    {
                                        $array[] = $item_tag->tags->name;
                                    }
                                    echo implode(',', $array);
                                }
                                else
                                {
                                    echo $items->item_tags[$tag_id]->tags->name;
                                }
                                ?>
                            </span>
                        </div>
                    </li>
                <?php endforeach; ?>
            <?php else: ?>
                <li>
                    Không tìm thấy sản phẩm nào
                </li>
            <?php endif; ?>
        </ul>
        <div style="clear:both">&nbsp;</div>
        <div class="span12">
            <?php $this->widget('CLinkPager', array('pages' => $pages)); ?>
        </div>
    </div>
</div>